import { SwaggerRouter } from 'koa-swagger-decorator';
import swaggerJson from './swagger-json'

const router = new SwaggerRouter();

// swagger docs avaliable at http://localhost:3000/api/v1/swagger-html
router.swagger(swaggerJson);

// mapDir will scan the input dir, and automatically call router.map to all Router Class
router.mapDir(__dirname, {
    // default: true. To recursively scan the dir to make router. If false, will not scan subroutes dir
    // recursive: true,
    // default: true, if true, you can call ctx.validatedBody[Query|Params] to get validated data.
    // doValidation: true,
});

export default router;